﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using StreamingClient.StreamManagment;

namespace VlcPlayer
{
    public class VlcList:List<VlcSettings>
    {
        
    }

    public class VlcSettings:INotifyPropertyChanged
    {
        public string Name { get; set; }
        private string _host;
        public string Host
        {
            get { return StreamingSettings.Host; }
            set { StreamingSettings.Host = value; NotifyPropertyChanged("Host");}
        }

        private int _port;
        public int Port
        {
            get { return StreamingSettings.ControlPort; }
            set { StreamingSettings.ControlPort = value; }
        }

        private StreamingSettings _streamingSettings;
        public StreamingSettings StreamingSettings
        {
            get
            {
                if (_streamingSettings == null)
                {
                    _streamingSettings = new StreamingSettings();
                }
                return _streamingSettings;
            }
            set { _streamingSettings = value; }
        }

        public VlcSettings()
        {
            Name = AppResources.Unnamed;
            Host = "";
            Port = 8080;
        }

        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

    }
}
